import request from '@/utils/request'

// 登录方法
export function login(username, password) {
  const data = {
    loginCode: username,
    password: password,
  }
  return request({
    'url': 'kangarooDataCenterV3/entranceController/option',
    header: {
      isToken: false,
      tl: 'loginService',
      as: 'sysTestjdbc',
      dj: 'doLogin'
    },
    'method': 'post',
    'data': data
  })
}
export function authApi(tl, as, dj, url = '', data) {
  return request({
    url: 'kangarooDataCenterV3/entranceController/option' + url,
    header: {
      tl: tl,
      as: as,
      dj: dj,
    },
    method: 'post',
    data: data
  })
}
// 获取用户详细信息
export function getInfo() {
  return request({
    'url': '/getInfo',
    'method': 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    'url': '/logout',
    'method': 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    'url': '/captchaImage',
    header: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}

// 钉钉单点登录
export function DDSSO(data) {
  return request({
    url: "Api/SSO/DDSSO",
    method: "post",
    data,
  });
}
// 钉钉认证
export function DDAuthen(data) {
  return request({
    url: "Api/SSO/DDAuthen",
    method: "post",
    data,
  });
}
// wx认证
export function WeChatSSO(data) {
  return request({
    url: "Api/SSO/WeChatSSO",
    method: "post",
    data,
  });
}
// wx认证
export function WeChatAuthen(data) {
  return request({
    url: "Api/SSO/WeChatAuthen",
    method: "post",
    data,
  });
}
// wx认证
export function GetAPPMenu(data) {
  return request({
    url: "/api/Menu/GetAPPMenu",
    method: "post",
    data,
  });
}

// 用户所属公司列表
export function OrganGetUserCompany(data) {
  return request({
    url: "/api/Organ/GetUserCompany",
    method: "post",
    data,
  });
}
//切换公司
export function ChangeCompany(data) {
  return request({
    url: "/api/Organ/ChangeCompany",
    method: "post",
    data,
  });
}